<%@ page contentType="text/html; charset=utf-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh">
<head>
	<title>后台管理 - 爱购物-商城</title>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css"/>
</head>
<body>
<c:import url="/static/page/manager-header-nav.jsp">
	<c:param name="nav" value="index"/>
</c:import>
<div id="position" class="wrap">
	您现在的位置：<a href="${pageContext.request.contextPath}/index">爱购物-商城</a> &gt; 管理后台 &gt; 新闻管理
</div>
<div id="main" class="wrap clearfix">
	<c:import url="/static/page/manage-left-nav.jsp"/>
	<div class="main">
		<h2>新闻管理</h2>
		<div class="manage">
			<table class="list">
				<tr>
					<th>ID</th>
					<th>新闻标题</th>
					<th>作者</th>
					<th>操作</th>
				</tr>
				<c:forEach var="n" items="${page.rows}">
				<tr>
					<td class="first w2 c">${n.id }</td>
					<td>${n.title }</td>
					<td class="w4 c">${n.author.username }</td>
					<td class="w4 c">
						<a href="${pageContext.request.contextPath}/manage/news/update?id=${n.id }">修改</a>
						<a href="javascript:deleteNews(${n.id });">删除</a>
					</td>
				</tr>
				</c:forEach>
			</table>
		</div>
	</div>
	<c:import url="/static/page/manage-pager.jsp">
		<c:param name="page" value="news"/>
		<c:param name="pageNo" value="${page.pageNo}"/>
		<c:param name="pages" value="${page.pages}"/>
		<c:param name="total" value="${page.total}"/>
	</c:import>
</div>
<c:import url="/static/page/footer.jsp"/>
<script>
	function deleteNews(id) {
		if (confirm("确定要删除该用户么？")) {
			location.href = "${pageContext.request.contextPath}/manage/user/delete?id=" + id;
		}
	}
</script>
</body>
</html>
